<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\vis\analysis\api\service\model;

class BmInvoicingInfo {
	
	static $_TSPEC;
	public $warehouseCode = null;
	public $warehouseName = null;
	public $poNo = null;
	public $itemCode = null;
	public $itemName = null;
	public $brandCode = null;
	public $brandName = null;
	public $payCategory = null;
	public $inventoryDate = null;
	public $beginningInventoryQty = null;
	public $inventoryInQty = null;
	public $inventoryOutQty = null;
	public $returnToVendorQty = null;
	public $allocatedInventoryInQty = null;
	public $allocatedInventoryOutQty = null;
	public $inventoryProfitQty = null;
	public $inventoryLossQty = null;
	public $returnFromCustomerReceivedQty = null;
	public $subscribedQty = null;
	public $qualityInventoryQty = null;
	public $defectiveInventoryQty = null;
	public $endingInventoryQty = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'warehouseCode'
			),
			2 => array(
			'var' => 'warehouseName'
			),
			3 => array(
			'var' => 'poNo'
			),
			4 => array(
			'var' => 'itemCode'
			),
			5 => array(
			'var' => 'itemName'
			),
			6 => array(
			'var' => 'brandCode'
			),
			7 => array(
			'var' => 'brandName'
			),
			8 => array(
			'var' => 'payCategory'
			),
			9 => array(
			'var' => 'inventoryDate'
			),
			10 => array(
			'var' => 'beginningInventoryQty'
			),
			11 => array(
			'var' => 'inventoryInQty'
			),
			12 => array(
			'var' => 'inventoryOutQty'
			),
			13 => array(
			'var' => 'returnToVendorQty'
			),
			14 => array(
			'var' => 'allocatedInventoryInQty'
			),
			15 => array(
			'var' => 'allocatedInventoryOutQty'
			),
			16 => array(
			'var' => 'inventoryProfitQty'
			),
			17 => array(
			'var' => 'inventoryLossQty'
			),
			18 => array(
			'var' => 'returnFromCustomerReceivedQty'
			),
			19 => array(
			'var' => 'subscribedQty'
			),
			20 => array(
			'var' => 'qualityInventoryQty'
			),
			21 => array(
			'var' => 'defectiveInventoryQty'
			),
			22 => array(
			'var' => 'endingInventoryQty'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['warehouseCode'])){
				
				$this->warehouseCode = $vals['warehouseCode'];
			}
			
			
			if (isset($vals['warehouseName'])){
				
				$this->warehouseName = $vals['warehouseName'];
			}
			
			
			if (isset($vals['poNo'])){
				
				$this->poNo = $vals['poNo'];
			}
			
			
			if (isset($vals['itemCode'])){
				
				$this->itemCode = $vals['itemCode'];
			}
			
			
			if (isset($vals['itemName'])){
				
				$this->itemName = $vals['itemName'];
			}
			
			
			if (isset($vals['brandCode'])){
				
				$this->brandCode = $vals['brandCode'];
			}
			
			
			if (isset($vals['brandName'])){
				
				$this->brandName = $vals['brandName'];
			}
			
			
			if (isset($vals['payCategory'])){
				
				$this->payCategory = $vals['payCategory'];
			}
			
			
			if (isset($vals['inventoryDate'])){
				
				$this->inventoryDate = $vals['inventoryDate'];
			}
			
			
			if (isset($vals['beginningInventoryQty'])){
				
				$this->beginningInventoryQty = $vals['beginningInventoryQty'];
			}
			
			
			if (isset($vals['inventoryInQty'])){
				
				$this->inventoryInQty = $vals['inventoryInQty'];
			}
			
			
			if (isset($vals['inventoryOutQty'])){
				
				$this->inventoryOutQty = $vals['inventoryOutQty'];
			}
			
			
			if (isset($vals['returnToVendorQty'])){
				
				$this->returnToVendorQty = $vals['returnToVendorQty'];
			}
			
			
			if (isset($vals['allocatedInventoryInQty'])){
				
				$this->allocatedInventoryInQty = $vals['allocatedInventoryInQty'];
			}
			
			
			if (isset($vals['allocatedInventoryOutQty'])){
				
				$this->allocatedInventoryOutQty = $vals['allocatedInventoryOutQty'];
			}
			
			
			if (isset($vals['inventoryProfitQty'])){
				
				$this->inventoryProfitQty = $vals['inventoryProfitQty'];
			}
			
			
			if (isset($vals['inventoryLossQty'])){
				
				$this->inventoryLossQty = $vals['inventoryLossQty'];
			}
			
			
			if (isset($vals['returnFromCustomerReceivedQty'])){
				
				$this->returnFromCustomerReceivedQty = $vals['returnFromCustomerReceivedQty'];
			}
			
			
			if (isset($vals['subscribedQty'])){
				
				$this->subscribedQty = $vals['subscribedQty'];
			}
			
			
			if (isset($vals['qualityInventoryQty'])){
				
				$this->qualityInventoryQty = $vals['qualityInventoryQty'];
			}
			
			
			if (isset($vals['defectiveInventoryQty'])){
				
				$this->defectiveInventoryQty = $vals['defectiveInventoryQty'];
			}
			
			
			if (isset($vals['endingInventoryQty'])){
				
				$this->endingInventoryQty = $vals['endingInventoryQty'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'BmInvoicingInfo';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("warehouseCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->warehouseCode);
				
			}
			
			
			
			
			if ("warehouseName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->warehouseName);
				
			}
			
			
			
			
			if ("poNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->poNo);
				
			}
			
			
			
			
			if ("itemCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->itemCode);
				
			}
			
			
			
			
			if ("itemName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->itemName);
				
			}
			
			
			
			
			if ("brandCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->brandCode);
				
			}
			
			
			
			
			if ("brandName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->brandName);
				
			}
			
			
			
			
			if ("payCategory" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->payCategory);
				
			}
			
			
			
			
			if ("inventoryDate" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->inventoryDate);
				
			}
			
			
			
			
			if ("beginningInventoryQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->beginningInventoryQty); 
				
			}
			
			
			
			
			if ("inventoryInQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->inventoryInQty); 
				
			}
			
			
			
			
			if ("inventoryOutQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->inventoryOutQty); 
				
			}
			
			
			
			
			if ("returnToVendorQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->returnToVendorQty); 
				
			}
			
			
			
			
			if ("allocatedInventoryInQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->allocatedInventoryInQty); 
				
			}
			
			
			
			
			if ("allocatedInventoryOutQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->allocatedInventoryOutQty); 
				
			}
			
			
			
			
			if ("inventoryProfitQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->inventoryProfitQty); 
				
			}
			
			
			
			
			if ("inventoryLossQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->inventoryLossQty); 
				
			}
			
			
			
			
			if ("returnFromCustomerReceivedQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->returnFromCustomerReceivedQty); 
				
			}
			
			
			
			
			if ("subscribedQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->subscribedQty); 
				
			}
			
			
			
			
			if ("qualityInventoryQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->qualityInventoryQty); 
				
			}
			
			
			
			
			if ("defectiveInventoryQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->defectiveInventoryQty); 
				
			}
			
			
			
			
			if ("endingInventoryQty" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->endingInventoryQty); 
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->warehouseCode !== null) {
			
			$xfer += $output->writeFieldBegin('warehouseCode');
			$xfer += $output->writeString($this->warehouseCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->warehouseName !== null) {
			
			$xfer += $output->writeFieldBegin('warehouseName');
			$xfer += $output->writeString($this->warehouseName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->poNo !== null) {
			
			$xfer += $output->writeFieldBegin('poNo');
			$xfer += $output->writeString($this->poNo);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->itemCode !== null) {
			
			$xfer += $output->writeFieldBegin('itemCode');
			$xfer += $output->writeString($this->itemCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->itemName !== null) {
			
			$xfer += $output->writeFieldBegin('itemName');
			$xfer += $output->writeString($this->itemName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->brandCode !== null) {
			
			$xfer += $output->writeFieldBegin('brandCode');
			$xfer += $output->writeString($this->brandCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->brandName !== null) {
			
			$xfer += $output->writeFieldBegin('brandName');
			$xfer += $output->writeString($this->brandName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->payCategory !== null) {
			
			$xfer += $output->writeFieldBegin('payCategory');
			$xfer += $output->writeString($this->payCategory);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->inventoryDate !== null) {
			
			$xfer += $output->writeFieldBegin('inventoryDate');
			$xfer += $output->writeString($this->inventoryDate);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->beginningInventoryQty !== null) {
			
			$xfer += $output->writeFieldBegin('beginningInventoryQty');
			$xfer += $output->writeI32($this->beginningInventoryQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->inventoryInQty !== null) {
			
			$xfer += $output->writeFieldBegin('inventoryInQty');
			$xfer += $output->writeI32($this->inventoryInQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->inventoryOutQty !== null) {
			
			$xfer += $output->writeFieldBegin('inventoryOutQty');
			$xfer += $output->writeI32($this->inventoryOutQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->returnToVendorQty !== null) {
			
			$xfer += $output->writeFieldBegin('returnToVendorQty');
			$xfer += $output->writeI32($this->returnToVendorQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->allocatedInventoryInQty !== null) {
			
			$xfer += $output->writeFieldBegin('allocatedInventoryInQty');
			$xfer += $output->writeI32($this->allocatedInventoryInQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->allocatedInventoryOutQty !== null) {
			
			$xfer += $output->writeFieldBegin('allocatedInventoryOutQty');
			$xfer += $output->writeI32($this->allocatedInventoryOutQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->inventoryProfitQty !== null) {
			
			$xfer += $output->writeFieldBegin('inventoryProfitQty');
			$xfer += $output->writeI32($this->inventoryProfitQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->inventoryLossQty !== null) {
			
			$xfer += $output->writeFieldBegin('inventoryLossQty');
			$xfer += $output->writeI32($this->inventoryLossQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->returnFromCustomerReceivedQty !== null) {
			
			$xfer += $output->writeFieldBegin('returnFromCustomerReceivedQty');
			$xfer += $output->writeI32($this->returnFromCustomerReceivedQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->subscribedQty !== null) {
			
			$xfer += $output->writeFieldBegin('subscribedQty');
			$xfer += $output->writeI32($this->subscribedQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->qualityInventoryQty !== null) {
			
			$xfer += $output->writeFieldBegin('qualityInventoryQty');
			$xfer += $output->writeI32($this->qualityInventoryQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->defectiveInventoryQty !== null) {
			
			$xfer += $output->writeFieldBegin('defectiveInventoryQty');
			$xfer += $output->writeI32($this->defectiveInventoryQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->endingInventoryQty !== null) {
			
			$xfer += $output->writeFieldBegin('endingInventoryQty');
			$xfer += $output->writeI32($this->endingInventoryQty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>